package com.sky.seata.order.controller;

import com.alibaba.fastjson.JSONObject;
import com.sky.seata.order.entity.SeataOrder;
import com.sky.seata.order.service.ISeataOrderService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Order)表控制层
 *
 * @author makejava
 * @since 2020-07-20 09:40:18
 */
@RestController
@RequestMapping("order")
public class OrderController {
    /**
     * 服务对象
     */
    @Resource
    private ISeataOrderService orderService;

    /**
     * 通过主键查询单条数据
     *
     * @return 单条数据
     */
    @GetMapping("insert")
    public SeataOrder insert() {
        return orderService.insert();
    }

    @GetMapping("insert2")
    public SeataOrder insert2() {
        return orderService.insert2();
    }

    @GetMapping("insert3")
    public Object insert3(){
        orderService.insert3();
        return "完成";
    }

    @GetMapping("selectByMaster")
    public SeataOrder selectByMaster(){
        return orderService.selectByMaster();
    }

    @GetMapping("selectBySlave")
    public SeataOrder selectBySlave(){
        return orderService.selectBySlave();
    }
}
